function Node(value) {
	this.value = value;
	this.left = null;
	this.right = null;
}
var a = new Node("a")
var b = new Node("b")
var c = new Node("c")
var d = new Node("d")
var e = new Node("e")
var f = new Node("f")
var g = new Node("g")

a.left = c;
a.right = b;
c.left = f;
c.right = g;
b.left = d;
b.right = e;

function f1(rootList, target) {
	if(rootList === null || rootList.length === 0) return false;
	var childList = [];  //当前层所有节点的 子节点  传入下一层
	for(var i = 0; i < rootList.length; i ++) {         //判断当前   当前没有 把子节点放入 childList
		console.log(rootList[i].value)
		if(rootList[i] !== null && rootList[i].value === target) {
			return true
		} else {
			childList.push(rootList[i].left);
			childList.push(rootList[i].right)

		}
	}
	return f1(childList, target)
}
console.log(f1([a], "f")) //a c b f   true


console.log(f1([a], "e")) // a c b f g d e    true
